<{include file="top.html"}>
</head>
<body>
<div class="xy-panel">
    <div class="xy-panel-top">
        <div class="xy-titlebar">
            <div class="xy-titlebar-left">
                <a class="left_arrow_gray_unlink" href="<{U('index/index ')}>"></a>
            </div>
            <div class="xy-titlebar-title" style="margin-left: 11%;">积分抽奖</div>
            <div class="xy-titlebar-right">
                <div class="spacer"></div>
                <a href="<{U('PointLottery/myRecord')}>">我的记录</a>
            </div>
        </div>
    </div>
    <div class="xy-panel-content" style="bottom:0;">
        <div class="xy-row vDirectionRow">
            <div class="nav-box">
                <ul class="nav-con" style="width:270px;">
                    <li class="nav-list" style="width:30%;" ><a href="<{U('PointLottery/index')}>&status=1">当前活动</a></li>
                    <li class="nav-list" style="width:30%;"><a href="<{U('PointLottery/index')}>&status=2">活动预告</a></li>
                    <li class="nav-list" style="width:30%;" ><a href="<{U('PointLottery/index')}>&status=3">往期回顾</a></li>
                    <li class="slider" style="width:30%;left:<{if $status==1}>0px;<{else if $status==2}>106px;<{else if $status==3}>212px;<{/if}>"></li>
                </ul>
            </div>
            <div id="more">
            <{include file="PointLottery/indexMore.html"}>
            </div>
            <dl class="moreshare">没有更多啦</dl>
        </div>
    </div>
</div>
<{include file="signBody.html"}>
</body>
</html>
<script src="<{$preStaticUrl}>Wap/js/flexible.js"></script>
<script type="text/javascript" src="<{$preStaticUrl}>Wap/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="<{$preStaticUrl}>Wap/js/nav.js"></script>
<script type="text/javascript">
    var page = 1;
    var loadFlag=1;
    var url = "<{U('PointLottery/indexMore')}>&status=<{$status}>";

    function load_more(page,url){
        $('.moreshare').html('下拉加载……');
        $.getJSON(url,{page:page},function(data){
            if(data.status != 0){
                layer.msg("数据获取失败，请稍后重试或联系管理员解决！");
            }else{
                $("#more").append(data.dataHtml);
                if(data.isPage == 1) {
                    loadFlag=1;
                } else {
                    $('.moreshare').html('没有更多啦！');
                }
            }
        });

    }

    $('.xy-panel-content').scroll(function(){
        var viewH =$(this).height(),//可见高度
            contentH =$(this).get(0).scrollHeight,//内容高度
            scrollTop =$(this).scrollTop();//滚动高度
        if (scrollTop/(contentH -viewH)>=0.99) {
            if(loadFlag==1){
                loadFlag=0;
                ++page;
                load_more(page,url);
            }
        }
    });


</script>
